#ifndef NOD_H
#define NOD_H
#include <iostream>
#include <cstdlib>
#define ISZERO(x) (fabsl(x) < 1e-100)
#define SWAPI(x, y) {x = x ^ y; y = x ^ y; x = x ^ y;}
#define ROUND(x) floorl(x + 0.5 + 1e-100)

char *ftoa(long double x);
void ftoa(long double x, char *buffer, int nrzec);
void ITOA(int x, char *buffer);
void afiseaza(char *text);
char *eliminaSpatiile(char *string);
char *cpystr(char *string1);
class Nod{
    protected:
        Nod *fStang, *fDrept;
        static long double x;
    public:
        Nod();
        ~Nod();

        virtual long double calcul() = 0;
        virtual char *derivare() = 0;
        virtual long double calculDerivata() = 0;
        virtual char *toString() = 0;

        Nod *getFStang();
        void setFStang(Nod *x);
        Nod *getFDrept();
        void setFDrept(Nod *x);

        static void setX(long double X);
        static long double getX();
};
#endif
